﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace XiaoYou.XuzhouZhihuiYinshui.Migrations
{
    public partial class add_waterquality_Anomaly_v3 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Min",
                table: "AppWaterQualityDatas",
                newName: "MinValue");

            migrationBuilder.RenameColumn(
                name: "Max",
                table: "AppWaterQualityDatas",
                newName: "MinAnomaly");

            migrationBuilder.RenameColumn(
                name: "Current",
                table: "AppWaterQualityDatas",
                newName: "MaxValue");

            migrationBuilder.AddColumn<bool>(
                name: "IsAnomaly",
                table: "AppWaterQualityHistories",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "IsMaxAnomaly",
                table: "AppWaterQualityHistories",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "IsMinAnomaly",
                table: "AppWaterQualityHistories",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<double>(
                name: "MaxAnomaly",
                table: "AppWaterQualityHistories",
                type: "double",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<double>(
                name: "MinAnomaly",
                table: "AppWaterQualityHistories",
                type: "double",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<double>(
                name: "CurrentValue",
                table: "AppWaterQualityDatas",
                type: "double",
                nullable: false,
                defaultValue: 0.0);

            migrationBuilder.AddColumn<double>(
                name: "MaxAnomaly",
                table: "AppWaterQualityDatas",
                type: "double",
                nullable: false,
                defaultValue: 0.0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsAnomaly",
                table: "AppWaterQualityHistories");

            migrationBuilder.DropColumn(
                name: "IsMaxAnomaly",
                table: "AppWaterQualityHistories");

            migrationBuilder.DropColumn(
                name: "IsMinAnomaly",
                table: "AppWaterQualityHistories");

            migrationBuilder.DropColumn(
                name: "MaxAnomaly",
                table: "AppWaterQualityHistories");

            migrationBuilder.DropColumn(
                name: "MinAnomaly",
                table: "AppWaterQualityHistories");

            migrationBuilder.DropColumn(
                name: "CurrentValue",
                table: "AppWaterQualityDatas");

            migrationBuilder.DropColumn(
                name: "MaxAnomaly",
                table: "AppWaterQualityDatas");

            migrationBuilder.RenameColumn(
                name: "MinValue",
                table: "AppWaterQualityDatas",
                newName: "Min");

            migrationBuilder.RenameColumn(
                name: "MinAnomaly",
                table: "AppWaterQualityDatas",
                newName: "Max");

            migrationBuilder.RenameColumn(
                name: "MaxValue",
                table: "AppWaterQualityDatas",
                newName: "Current");
        }
    }
}
